<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"
      xmlns:c="http://java.sun.com/jsp/jstl/core"
      xmlns:f="http://java.sun.com/jsf/core">

<h:head>
    <title>祖龙娱乐  - BI系统</title>
    <link href="../../css/component.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="../../js/highcharts.js"></script>
    <script type="text/javascript" src="../../js/drawChart.js"></script>
</h:head>

<h:body>
    <ui:param name="bean" value="#{taskGameAction}" />

    <span class="pagetitle">游戏内分析 —— 任务分析</span>
    <p:separator />

    <!-- 右侧页面顶部查询部分 -->
    <h:form id="fsearch">
        <p:growl id="growl" showDetail="true" sticky="true" />
        <p:calendar value="#{bean.dayDate}" mode="popup" pattern="yyyy-MM-dd" />
        &#160;&#160;&#160;

        <p:selectOneMenu id="platformSel" styleClass="queryPlatform" value="#{bean.queryPlatform}">
            <f:selectItems value="#{bean.platformItmes}" />
            <p:ajax update="channelSel serverSel" listener="#{bean.updateChannelItmes}" />
        </p:selectOneMenu>
        &#160;&#160;&#160;

        <p:selectOneMenu id="channelSel" styleClass="queryChannel" value="#{bean.queryChannel}">
            <f:selectItems value="#{bean.channelItmes}" />
            <p:ajax update="serverSel platformSel" listener="#{bean.updateServerItmes}" />
        </p:selectOneMenu>
        &#160;&#160;&#160;

        <p:selectOneMenu id="serverSel" styleClass="queryServer" value="#{bean.queryServer}">
            <f:selectItems value="#{bean.serverItmes}" />
            <p:ajax update="channelSel platformSel" listener="#{bean.selectedServer}" />
        </p:selectOneMenu>
        &#160;&#160;&#160;

        <p:selectOneMenu id="taskTypeSel" styleClass="queryServer" value="#{bean.queryTaskType}">
            <f:selectItems value="#{bean.taskTypeItmes}" />
            <p:ajax update="taskNameSel" listener="#{bean.selectTaskType}"/>
        </p:selectOneMenu>
        &#160;&#160;&#160;

        <p:selectOneMenu id="taskNameSel" styleClass="queryServer" value="#{bean.queryTaskName}">
            <f:selectItems value="#{bean.uiTaskNameItmes}" />
            <p:ajax update="taskTypeSel" listener="#{bean.selectTaskName}"/>
        </p:selectOneMenu>
        &#160;&#160;&#160;

        <p:commandButton value="查询" action="#{bean.search()}" update=":data" ajax="false" />
    </h:form>
    <br />

    <!-- 数据展示部分，包含表格和图表 -->
    <h:form id="dform">
        <h:panelGrid columns="1" style="width:100%">
            <div id="basewidth" style="width:92%;height:0;border:0;">
            </div>
        </h:panelGrid>

        <div class="data" id="data">
            <p:panel id="panel10" header="活跃用户主线任务转化情况" style="margin-bottom:10px;">
                <p:dataGrid id="chart10" var="c" value="#{bean.activeUserTaskCompletedChartTran}" columns="1" layout="grid">
                    <p:panel style="text-align:center">
                        <h:panelGrid columns="1" style="width:100%">
                            <div id="highchartChart10" style="width:100%;height:350px; border:0;">
                                <script type="text/javascript">
                                    generateChart('#{c.jsonStr}', '#{c.jsonType}', '10');
                                </script>
                            </div>
                        </h:panelGrid>
                    </p:panel>
                </p:dataGrid>

                <p:dataTable id="dlist10" var="l" value="#{bean.activeUserTaskCompletedsTran}"  resizableColumns="true" paginator="true" paginatorPosition="top" paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}  {Exporters}" rowsPerPageTemplate="10,20,30" rows="10" style="text-align:center;">
                    <f:facet name="{Exporters}">
                        <h:commandLink  styleClass="exporter">
                            <p:graphicImage url="/resources/images/excel.png" height="25px"/>
                            <p:dataExporter type="xls" target="dlist10" fileName="activeUserTaskCompleteds-#{pageHelper.getNewDateDetailStr()}"/>
                        </h:commandLink>
                    </f:facet>

                    <p:column headerText="日期" styleClass="column grcnewDevice" sortBy="#{l.dateStr}">
                        <h:outputLabel value="#{l.dateStr}" />
                    </p:column>
                    <p:column headerText="任务类型" styleClass="column grcnewUser" sortBy="#{l.taskType}">
                        <h:outputLabel value="#{l.taskType}" />
                    </p:column>
                    <p:column headerText="任务id" styleClass="column grcnewUser" sortBy="#{l.taskId}">
                        <h:outputLabel value="#{l.taskId}" />
                    </p:column>
                    <p:column headerText="任务名称" styleClass="column grcnewUser" sortBy="#{l.taskName}">
                        <h:outputLabel value="#{l.taskName}" />
                    </p:column>
                    <p:column headerText="开启等级" styleClass="column grcnewUser" sortBy="#{l.openLevel}" rendered="false">
                        <h:outputLabel value="#{l.openLevel}" />
                    </p:column>
                    <p:column headerText="满足条件角色数" styleClass="column grcnewUser" sortBy="#{l.okUserNum}" rendered="false">
                        <h:outputLabel value="#{l.okUserNum}" />
                    </p:column>
                    <p:column headerText="参与角色数" styleClass="column grcnewUser" sortBy="#{l.playUserNum}">
                        <h:outputLabel value="#{l.playUserNum}" />
                    </p:column>
                    <p:column headerText="参与率" styleClass="columnleft grcnewUser" sortBy="#{l.playRadio}" rendered="false">
                        <img src="../../images/pe.png" width="#{pageHelper.double2Percent(l.playRadio - 0.4)}" height="12px" />&#160;
                        <h:outputLabel value="#{pageHelper.double2Percent(l.playRadio)}" />
                    </p:column>
                    <p:column headerText="参与次数" styleClass="column grcnewUser" sortBy="#{l.playTimes}">
                        <h:outputLabel value="#{l.playTimes}" />
                    </p:column>
                    <p:column headerText="转化率" styleClass="columnleft grcnewUser" sortBy="#{l.okRadio}">
                        <img src="../../images/pe.png" width="#{pageHelper.double2Percent(l.okRadio - 0.4)}" height="12px" />&#160;
                        <h:outputLabel value="#{pageHelper.double2Percent(l.okRadio)}" />
                    </p:column>
                    <p:column headerText="人均次数" styleClass="column grcnewUser" sortBy="#{l.avgPlayTimes}">
                        <h:outputLabel value="#{l.avgPlayTimes}" />
                    </p:column>
                    <p:column headerText="平均完成时间(m)" styleClass="column grcnewUser" sortBy="#{l.avgTime}">
                        <h:outputLabel value="#{l.avgTime}" />
                    </p:column>
                </p:dataTable>
            </p:panel>
            <br />

            <p:panel id="panel20" header="新增用户主线任务转化情况" style="margin-bottom:10px;">
                <p:dataGrid id="chart20" var="c" value="#{bean.newUserTaskCompletedChartTran}" columns="1" layout="grid">
                    <p:panel style="text-align:center">
                        <h:panelGrid columns="1" style="width:100%">
                            <div id="highchartChart20" style="width:100%;height:350px; border:0;">
                                <script type="text/javascript">
                                    generateChart('#{c.jsonStr}', '#{c.jsonType}', '20');
                                </script>
                            </div>
                        </h:panelGrid>
                    </p:panel>
                </p:dataGrid>

                <p:dataTable id="dlist20" var="l" value="#{bean.newUserTaskCompletedsTran}"  resizableColumns="true" paginator="true" paginatorPosition="top" paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}  {Exporters}" rowsPerPageTemplate="10,20,30" rows="10" style="text-align:center;">
                    <f:facet name="{Exporters}">
                        <h:commandLink  styleClass="exporter">
                            <p:graphicImage url="/resources/images/excel.png" height="25px"/>
                            <p:dataExporter type="xls" target="dlist20" fileName="newUserTaskCompleteds-#{pageHelper.getNewDateDetailStr()}"/>
                        </h:commandLink>
                    </f:facet>

                    <p:column headerText="日期" styleClass="column grcnewDevice" sortBy="#{l.dateStr}">
                        <h:outputLabel value="#{l.dateStr}" />
                    </p:column>
                    <p:column headerText="任务类型" styleClass="column grcnewUser" sortBy="#{l.taskType}">
                        <h:outputLabel value="#{l.taskType}" />
                    </p:column>
                    <p:column headerText="任务id" styleClass="column grcnewUser" sortBy="#{l.taskId}">
                        <h:outputLabel value="#{l.taskId}" />
                    </p:column>
                    <p:column headerText="任务名称" styleClass="column grcnewUser" sortBy="#{l.taskName}">
                        <h:outputLabel value="#{l.taskName}" />
                    </p:column>
                    <p:column headerText="开启等级" styleClass="column grcnewUser" sortBy="#{l.openLevel}" rendered="false">
                        <h:outputLabel value="#{l.openLevel}" />
                    </p:column>
                    <p:column headerText="满足条件角色数" styleClass="column grcnewUser" sortBy="#{l.okUserNum}" rendered="false">
                        <h:outputLabel value="#{l.okUserNum}" />
                    </p:column>
                    <p:column headerText="参与角色数" styleClass="column grcnewUser" sortBy="#{l.playUserNum}">
                        <h:outputLabel value="#{l.playUserNum}" />
                    </p:column>
                    <p:column headerText="参与率" styleClass="columnleft grcnewUser" sortBy="#{l.playRadio}" rendered="false">
                        <img src="../../images/pe.png" width="#{pageHelper.double2Percent(l.playRadio - 0.4)}" height="12px" />&#160;
                        <h:outputLabel value="#{pageHelper.double2Percent(l.playRadio)}" />
                    </p:column>
                    <p:column headerText="参与次数" styleClass="column grcnewUser" sortBy="#{l.playTimes}">
                        <h:outputLabel value="#{l.playTimes}" />
                    </p:column>
                    <p:column headerText="转化率" styleClass="columnleft grcnewUser" sortBy="#{l.okRadio}">
                        <img src="../../images/pe.png" width="#{pageHelper.double2Percent(l.okRadio - 0.4)}" height="12px" />&#160;
                        <h:outputLabel value="#{pageHelper.double2Percent(l.okRadio)}" />
                    </p:column>
                    <p:column headerText="人均次数" styleClass="column grcnewUser" sortBy="#{l.avgPlayTimes}">
                        <h:outputLabel value="#{l.avgPlayTimes}" />
                    </p:column>
                    <p:column headerText="平均完成时间(m)" styleClass="column grcnewUser" sortBy="#{l.avgTime}">
                        <h:outputLabel value="#{l.avgTime}" />
                    </p:column>
                </p:dataTable>
            </p:panel>
            <br />


            <p:panel id="panel1" header="活跃用户完成情况" style="margin-bottom:10px;">
                <p:dataGrid id="chart1" var="c" value="#{bean.activeUserTaskCompletedChart}" columns="1" layout="grid" rendered="false">
                    <p:panel style="text-align:center">
                        <h:panelGrid columns="1" style="width:100%">
                            <div id="highchartChart1" style="width:100%;height:350px; border:0;">
                                <script type="text/javascript">
                                    generateChart('#{c.jsonStr}', '#{c.jsonType}', '1');
                                </script>
                            </div>
                        </h:panelGrid>
                    </p:panel>
                </p:dataGrid>

                <p:dataTable id="dlist1" var="l" value="#{bean.activeUserTaskCompleteds}"  resizableColumns="true" paginator="true" paginatorPosition="top" paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}  {Exporters}" rowsPerPageTemplate="10,20,30" rows="10" style="text-align:center;">
                    <f:facet name="{Exporters}">
                        <h:commandLink  styleClass="exporter">
                            <p:graphicImage url="/resources/images/excel.png" height="25px"/>
                            <p:dataExporter type="xls" target="dlist1" fileName="activeUserTaskCompleteds-#{pageHelper.getNewDateDetailStr()}"/>
                        </h:commandLink>
                    </f:facet>

                    <p:column headerText="日期" styleClass="column grcnewDevice" sortBy="#{l.dateStr}">
                        <h:outputLabel value="#{l.dateStr}" />
                    </p:column>
                    <p:column headerText="任务类型" styleClass="column grcnewUser" sortBy="#{l.taskType}">
                        <h:outputLabel value="#{l.taskType}" />
                    </p:column>
                    <p:column headerText="任务id" styleClass="column grcnewUser" sortBy="#{l.taskId}">
                        <h:outputLabel value="#{l.taskId}" />
                    </p:column>
                    <p:column headerText="任务名称" styleClass="column grcnewUser" sortBy="#{l.taskName}">
                        <h:outputLabel value="#{l.taskName}" />
                    </p:column>
                    <p:column headerText="开启等级" styleClass="column grcnewUser" sortBy="#{l.openLevel}" rendered="false">
                        <h:outputLabel value="#{l.openLevel}" />
                    </p:column>
                    <p:column headerText="满足条件角色数" styleClass="column grcnewUser" sortBy="#{l.okUserNum}" rendered="false">
                        <h:outputLabel value="#{l.okUserNum}" />
                    </p:column>
                    <p:column headerText="参与角色数" styleClass="column grcnewUser" sortBy="#{l.playUserNum}">
                        <h:outputLabel value="#{l.playUserNum}" />
                    </p:column>
                    <p:column headerText="参与率" styleClass="columnleft grcnewUser" sortBy="#{l.playRadio}" rendered="false">
                        <img src="../../images/pe.png" width="#{pageHelper.double2Percent(l.playRadio - 0.4)}" height="12px" />&#160;
                        <h:outputLabel value="#{pageHelper.double2Percent(l.playRadio)}" />
                    </p:column>
                    <p:column headerText="参与次数" styleClass="column grcnewUser" sortBy="#{l.playTimes}">
                        <h:outputLabel value="#{l.playTimes}" />
                    </p:column>
                    <p:column headerText="成功率" styleClass="columnleft grcnewUser" sortBy="#{l.okRadio}">
                        <img src="../../images/pe.png" width="#{pageHelper.double2Percent(l.okRadio - 0.4)}" height="12px" />&#160;
                        <h:outputLabel value="#{pageHelper.double2Percent(l.okRadio)}" />
                    </p:column>
                    <p:column headerText="人均次数" styleClass="column grcnewUser" sortBy="#{l.avgPlayTimes}">
                        <h:outputLabel value="#{l.avgPlayTimes}" />
                    </p:column>
                    <p:column headerText="平均完成时间(m)" styleClass="column grcnewUser" sortBy="#{l.avgTime}">
                        <h:outputLabel value="#{l.avgTime}" />
                    </p:column>
                </p:dataTable>
            </p:panel>
            <br />

            <p:panel id="panel2" header="新增用户完成情况" style="margin-bottom:10px;">
                <p:dataGrid id="chart2" var="c" value="#{bean.newUserTaskCompletedChart}" columns="1" layout="grid" rendered="false">
                    <p:panel style="text-align:center">
                        <h:panelGrid columns="1" style="width:100%">
                            <div id="highchartChart2" style="width:100%;height:350px; border:0;">
                                <script type="text/javascript">
                                    generateChart('#{c.jsonStr}', '#{c.jsonType}', '2');
                                </script>
                            </div>
                        </h:panelGrid>
                    </p:panel>
                </p:dataGrid>

                <p:dataTable id="dlist2" var="l" value="#{bean.newUserTaskCompleteds}"  resizableColumns="true" paginator="true" paginatorPosition="top" paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}  {Exporters}" rowsPerPageTemplate="10,20,30" rows="10" style="text-align:center;">
                    <f:facet name="{Exporters}">
                        <h:commandLink  styleClass="exporter">
                            <p:graphicImage url="/resources/images/excel.png" height="25px"/>
                            <p:dataExporter type="xls" target="dlist2" fileName="newUserTaskCompleteds-#{pageHelper.getNewDateDetailStr()}"/>
                        </h:commandLink>
                    </f:facet>

                    <p:column headerText="日期" styleClass="column grcnewDevice" sortBy="#{l.dateStr}">
                        <h:outputLabel value="#{l.dateStr}" />
                    </p:column>
                    <p:column headerText="任务类型" styleClass="column grcnewUser" sortBy="#{l.taskType}">
                        <h:outputLabel value="#{l.taskType}" />
                    </p:column>
                    <p:column headerText="任务id" styleClass="column grcnewUser" sortBy="#{l.taskId}">
                        <h:outputLabel value="#{l.taskId}" />
                    </p:column>
                    <p:column headerText="任务名称" styleClass="column grcnewUser" sortBy="#{l.taskName}">
                        <h:outputLabel value="#{l.taskName}" />
                    </p:column>
                    <p:column headerText="开启等级" styleClass="column grcnewUser" sortBy="#{l.openLevel}" rendered="false">
                        <h:outputLabel value="#{l.openLevel}" />
                    </p:column>
                    <p:column headerText="满足条件角色数" styleClass="column grcnewUser" sortBy="#{l.okUserNum}" rendered="false">
                        <h:outputLabel value="#{l.okUserNum}" />
                    </p:column>
                    <p:column headerText="参与角色数" styleClass="column grcnewUser" sortBy="#{l.playUserNum}">
                        <h:outputLabel value="#{l.playUserNum}" />
                    </p:column>
                    <p:column headerText="参与率" styleClass="columnleft grcnewUser" sortBy="#{l.playRadio}" rendered="false">
                        <img src="../../images/pe.png" width="#{pageHelper.double2Percent(l.playRadio - 0.4)}" height="12px" />&#160;
                        <h:outputLabel value="#{pageHelper.double2Percent(l.playRadio)}" />
                    </p:column>
                    <p:column headerText="参与次数" styleClass="column grcnewUser" sortBy="#{l.playTimes}">
                        <h:outputLabel value="#{l.playTimes}" />
                    </p:column>
                    <p:column headerText="成功率" styleClass="columnleft grcnewUser" sortBy="#{l.okRadio}">
                        <img src="../../images/pe.png" width="#{pageHelper.double2Percent(l.okRadio - 0.4)}" height="12px" />&#160;
                        <h:outputLabel value="#{pageHelper.double2Percent(l.okRadio)}" />
                    </p:column>
                    <p:column headerText="人均次数" styleClass="column grcnewUser" sortBy="#{l.avgPlayTimes}">
                        <h:outputLabel value="#{l.avgPlayTimes}" />
                    </p:column>
                    <p:column headerText="平均完成时间(m)" styleClass="column grcnewUser" sortBy="#{l.avgTime}">
                        <h:outputLabel value="#{l.avgTime}" />
                    </p:column>
                </p:dataTable>
            </p:panel>
            <br />

            <p:panel id="panel3" header="活跃用户停留率（Top15）" style="margin-bottom:10px;" rendered="false">
                <p:dataTable id="dlist3" var="l" value="#{bean.activeUserTaskStayRadios}"  resizableColumns="true" paginator="true" paginatorPosition="top" paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}  {Exporters}" rowsPerPageTemplate="10,20,30" rows="10" style="text-align:center;">
                    <f:facet name="{Exporters}">
                        <h:commandLink  styleClass="exporter">
                            <p:graphicImage url="/resources/images/excel.png" height="25px"/>
                            <p:dataExporter type="xls" target="dlist3" fileName="activeUserTaskStayRadios-#{pageHelper.getNewDateDetailStr()}"/>
                        </h:commandLink>
                    </f:facet>

                    <p:column headerText="日期" styleClass="column grcnewDevice" sortBy="#{l.dateStr}">
                        <h:outputLabel value="#{l.dateStr}" />
                    </p:column>
                    <p:column headerText="任务类型" styleClass="column grcnewDevice" sortBy="#{l.taskType}">
                        <h:outputLabel value="#{l.taskType}" />
                    </p:column>
                    <p:column headerText="任务ID" styleClass="column grcnewDevice" sortBy="#{l.taskId}">
                        <h:outputLabel value="#{l.taskId}" />
                    </p:column>
                    <p:column headerText="任务名称" styleClass="column grcnewDevice" sortBy="#{l.taskName}">
                        <h:outputLabel value="#{l.taskName}" />
                    </p:column>
                    <p:column headerText="停留角色数" styleClass="column grcnewUser" sortBy="#{l.stayUserNum}">
                        <h:outputLabel value="#{l.stayUserNum}" />
                    </p:column>
                    <p:column headerText="停留率" styleClass="columnleft grcnewUser" sortBy="#{l.stayRadio}">
                        <img src="../../images/pe.png" width="#{pageHelper.double2Percent(l.stayRadio - 0.4)}" height="12px" />&#160;
                        <h:outputLabel value="#{pageHelper.double2Percent(l.stayRadio)}" />
                    </p:column>
                </p:dataTable>
            </p:panel>
            <br />

            <p:panel id="panel4" header="新增次日流失停留率（Top15）" style="margin-bottom:10px;" rendered="false">
                <p:dataTable id="dlist4" var="l" value="#{bean.newUserTaskStayRadios}"  resizableColumns="true" paginator="true" paginatorPosition="top" paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}  {Exporters}" rowsPerPageTemplate="10,20,30" rows="10" style="text-align:center;">
                    <f:facet name="{Exporters}">
                        <h:commandLink  styleClass="exporter">
                            <p:graphicImage url="/resources/images/excel.png" height="25px"/>
                            <p:dataExporter type="xls" target="dlist4" fileName="newUserTaskStayRadios-#{pageHelper.getNewDateDetailStr()}"/>
                        </h:commandLink>
                    </f:facet>

                    <p:column headerText="日期" styleClass="column grcnewDevice" sortBy="#{l.dateStr}">
                        <h:outputLabel value="#{l.dateStr}" />
                    </p:column>
                    <p:column headerText="任务类型" styleClass="column grcnewDevice" sortBy="#{l.taskType}">
                        <h:outputLabel value="#{l.taskType}" />
                    </p:column>
                    <p:column headerText="任务ID" styleClass="column grcnewDevice" sortBy="#{l.taskId}">
                        <h:outputLabel value="#{l.taskId}" />
                    </p:column>
                    <p:column headerText="任务名称" styleClass="column grcnewDevice" sortBy="#{l.taskName}">
                        <h:outputLabel value="#{l.taskName}" />
                    </p:column>
                    <p:column headerText="停留角色数" styleClass="column grcnewUser" sortBy="#{l.stayUserNum}">
                        <h:outputLabel value="#{l.stayUserNum}" />
                    </p:column>
                    <p:column headerText="停留率" styleClass="columnleft grcnewUser" sortBy="#{l.stayRadio}">
                        <img src="../../images/pe.png" width="#{pageHelper.double2Percent(l.stayRadio - 0.4)}" height="12px" />&#160;
                        <h:outputLabel value="#{pageHelper.double2Percent(l.stayRadio)}" />
                    </p:column>
                </p:dataTable>
            </p:panel>
        </div>
    </h:form>

    <!-- 页脚 -->
    <div class="footer"></div>
</h:body>
</html>